<?php
/**
 * @testDonor.php
 * Controls the model for Donor.php.
 *
 * Copyright 2011 by Matthew Wakim.  This program is part of Donate.
 * Donate is free software.  It comes with absolutely no warranty.
 * You can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 * 
 * @version March 5th 2011
 * @author Matthew Wakim
 */

  /** first I include the php file I'm testing
  */
 include_once(dirname(__FILE__).'/../model/donor.php');
 class testDoner extends UnitTestCase {
      function testDonerModule() {
 /** I need to make an object to test. This is just dummy data.
 */
 $myDoner = new Doner("1", "Street", "city", "state", "zip", "phone", "fax", "eMail" );

 /** first assertion - check that a getter is working from the initialized data
 */
 $this->assertTrue($myDoner->get_first_name()=="1");


 $this->assertTrue(!in_array("User", $myDoner->get_type()));
 /** now let's add it
 */
 $myDoner->add_type("User");
 $this->assertTrue(in_array("User", $myDoner->get_type()));
 /** now we should remove it
 */
 $myDoner->remove_type("User");
 $this->assertTrue(!in_array("User", $myDoner->get_type()));

 /** So if all $this->assertTrue's cleared, running this script will output testDoners complete".
 */
 $this->assertTrue($myDoner->get_type() !== "notMyLastName");

 /** Test type functions
 */
 $myDoner->add_ID("1");
 $myDoner->add_ID("2");
 
 /** should be available since we just added it.
 */
 $this->assertTrue($myDoner->is_type("org"));
 /** now let's remove it and test
 */
 $myDoner->remove_type("ind");
 $this->assertTrue(!$myDoner->is_type("ind"));

 echo("testDoner complete");
      }
 }

?>
